﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProductDetail.aspx.cs" ValidateRequest="false"  Inherits="Pages_Admin_ProductDetail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript"  src="../../JS/datatime.js"></script>
     <script type="text/javascript">
        function checkFile(ele)
        {
            var fileName = ele.value;
            var pattern = /\.jpg$|\.jpeg$|\.gif$|\.png$|\.bmp$|\.mov$|\.mpeg$|\.mpg$|\.avi$|\.wmv$||\.M$/gi;

            if(!pattern.test(fileName))
            {
                alert("文件格式不合规范！");
                return false;
            }
            else
            {
                return true;
            }
        }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div style="text-align:left">
        <asp:DetailsView runat="server" ID="dtvProducts" AutoGenerateRows="False"  DataKeyNames="ProductID"
            DefaultMode="Insert" DataSourceID="odsProducts" 
            oniteminserted="dtvProducts_ItemInserted" 
            onitemupdated="dtvProducts_ItemUpdated" >
        <Fields>
            <asp:TemplateField>
                <InsertItemTemplate>
              <table cellSpacing="0" cellPadding="0" border="0">
	<tr>
	<td height="25" width="30%" align="right">团购标题：</td>
	<td height="25">
		<asp:TextBox id="txtProductName" Text='<%# Bind("ProductName") %>' runat="server" Width="350px"></asp:TextBox>
	</td></tr>
	<tr>
	<tr>
	<td height="25" width="30%" align="right">产品名称：</td>
	<td height="25">
		<asp:TextBox id="txtTitle" Text='<%# Bind("Title") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">关键字：</td>
	<td height="25">
		<asp:TextBox id="txtKeys" Text='<%# Bind("Keys") %>' runat="server" Width="200px"></asp:TextBox>多个用逗号(,)分割
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">城市	：</td>
	<td height="25" width="*" align="left">
	    <asp:DropDownList ID="ddlCity" runat="server"   DataSourceID="ObjectDataSource1" 
            DataTextField="CityName" DataValueField="CityID" 
            SelectedValue='<%# Bind("CityID") %>'>
        </asp:DropDownList>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllList" 
            TypeName="Tuan.BLL.City"></asp:ObjectDataSource>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		出售价格：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtNowPrice" Text='<%# Bind("NowPrice") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		最低数量(成团)：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtminnumber" runat="server"  Text='<%# Bind("MinNumber") %>' Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		最多购买数量：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtMaxCount" runat="server"  Text='<%# Bind("MaxCount") %>' Width="200px"></asp:TextBox>0为不限制购买数量
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		最多使用虚拟币：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtLimitToken" runat="server"  Text='<%# Bind("LimitToken") %>' Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		正常折扣价格：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtDiscountPrice"  Text='<%# Bind("DiscountPrice") %>' runat="server" Width="200px"></asp:TextBox>与商户协商的正常折扣价格<br />(填写0为未提供折扣价)
	</td></tr>
	
	<tr>
	<td height="25" width="30%" align="right">
		原价：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtOldPrice"  Text='<%# Bind("OldPrice") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		是否需要配送：</td>
	<td height="25" width="*" align="left">
		<asp:CheckBox ID="chkCarr" Checked='<%# Bind("Carrying") %>' runat="server" />
	</td></tr>
	
	<tr>
	<td height="25" width="30%" align="right">展出日期：</td>
	<td height="25" width="*" align="left"><INPUT onselectstart="return false;" runat="server"  value='<%# Bind("ShowDate") %>'
	 onkeypress="return false" id="txtShowDate" onblur="showHint(this,1)" onfocus="showHint(this,10,'outDate')"  type="text" size="10" name="Text1">
		 结束日期:<INPUT onselectstart="return false;" onkeypress="return false" id="txtEndDate" onfocus="setday(this)"
		  type="text" size="10" name="enddate" value='<%# Bind("EndDate") %>' runat="server" />		
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
	<tr>
	
	<td height="25" width="30%" align="right">
		图片：</td>
	<td height="25" width="*" align="left">
	<asp:FileUpload ID="FileUpload1" onchange="checkFile(this)" runat="server" />
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		产品描述：</td>
	<td height="25" width="*" align="left">
	 <input type="hidden" runat="server"  name="Summary" id="TxtDes" value='<%# Bind("Des") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_TxtDes" frameborder="0" scrolling="no" width="380" height="180"></iframe>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">产品特色：</td>
	<td height="25" width="*" align="left">
	 <input type="hidden" runat="server"  name="txtFeature" id="txtFeature" value='<%# Bind("Feature") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtFeature" frameborder="0" scrolling="no" width="380" height="180"></iframe>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		产品信息
	：</td>
	<td height="25" width="*" align="left"><a onclick="javascript:window.open('Misc/upfile.aspx', '', 'width=400,height=250,resizable=0,scrollbars=no');"  style="text-decoration:underline; cursor:pointer" target="_blank">上传图片</a>
	<input type="hidden" runat="server"  name="txtProductInfo" id="txtProductInfo" value='<%# Bind("ProductInfo") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtProductInfo" frameborder="0" scrolling="no" width="420" height="340"></iframe>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		网络评论
	：</td>
	<td height="25" width="*" align="left">
	<input type="hidden" runat="server"  name="txtNetComment" id="txtNetComment" value='<%# Bind("NetComment") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtNetComment" frameborder="0" scrolling="no" width="420" height="200"></iframe>
	
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right"> 我们评论	：</td>
	<td height="25" width="*" align="left">
	
		<asp:TextBox id="txtWeComment" runat="server" BorderStyle="Dashed" Text='<%# Bind("WeComment") %>'  Rows="10" TextMode="MultiLine" Width="380px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		联系方式
	：</td>
	<td height="25" width="*" align="left">
	<input type="hidden" runat="server"  name="txtContact" id="txtContact" value='<%# Bind("Contact") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtContact" frameborder="0" scrolling="no" width="380" height="340"></iframe>
	
	</td></tr>
	
	<tr>
	<td height="25" width="30%" align="right"> 备注	：</td>
	<td height="25" width="*" align="left">
	
		<asp:TextBox id="txtRemark" runat="server" BorderStyle="Dashed" Text='<%# Bind("Remark") %>'  Rows="3" TextMode="MultiLine" Width="380px"></asp:TextBox>
	</td></tr>
	
	
	<tr>
	<td height="25" width="30%" align="right"> 商户名称	：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtOwnerName"   Text='<%# Bind("OwnerName") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right"> 商户电话	：</td>
	<td height="25">
		<asp:TextBox id="txtOwnerTel" Text='<%# Bind("OwnerTel") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	

	<tr>
	<td height="25" width="30%" align="right">
		操作员	：</td>
	<td height="25" width="*" align="left">
	<asp:LoginName ID="lgnName" runat="server" />
	</td></tr>
	
	
	<tr>
	<td height="25" colspan="2"><div align="center">
		<asp:Button ID="btnAdd" runat="server" Text="· 提交 ·"  CommandName="Insert"></asp:Button>
	</div></td></tr>
</table>
           </InsertItemTemplate>
              <EditItemTemplate>
              <table cellSpacing="0" cellPadding="0" border="0">
              <tr>
	<td height="25" colspan="2"><div align="center">
		<asp:Button ID="Button1" runat="server" Text="· 更新 ·"  CommandName="Update"></asp:Button>
	</div></td></tr>
	<tr>
	<td height="25" width="30%" align="right">手动刷数量：</td>
	<td height="25">
		<asp:TextBox id="txtMakeNum" Text='<%# Bind("MakeNum") %>' runat="server"></asp:TextBox>手动刷数量
	</td></tr>
	
	<tr>
	<td height="25" width="30%" align="right">团购标题：</td>
	<td height="25">
		<asp:TextBox id="txtProductName" Text='<%# Bind("ProductName") %>' runat="server" Width="350px"></asp:TextBox>
	</td></tr>
	<tr>
	<tr>
	<td height="25" width="30%" align="right">产品名称：</td>
	<td height="25">
		<asp:TextBox id="txtTitle" Text='<%# Bind("Title") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">关键字：</td>
	<td height="25">
		<asp:TextBox id="txtKeys" Text='<%# Bind("Keys") %>' runat="server" Width="200px"></asp:TextBox>多个用逗号(,)分割
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">城市	：</td>
	<td height="25" width="*" align="left">
	    <asp:DropDownList ID="ddlCity" runat="server"   DataSourceID="ObjectDataSource1" 
            DataTextField="CityName" DataValueField="CityID" 
            SelectedValue='<%# Bind("CityID") %>'>
        </asp:DropDownList>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllList" 
            TypeName="Tuan.BLL.City"></asp:ObjectDataSource>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		出售价格：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtNowPrice" Text='<%# Bind("NowPrice") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		最低数量(成团)：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtminnumber" runat="server"  Text='<%# Bind("MinNumber") %>' Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		最多购买数量：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtMaxCount" runat="server"  Text='<%# Bind("MaxCount") %>' Width="200px"></asp:TextBox>0为不限制购买数量
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		最多使用虚拟币：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtLimitToken" runat="server"  Text='<%# Bind("LimitToken") %>' Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		正常折扣价格：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtDiscountPrice"  Text='<%# Bind("DiscountPrice") %>' runat="server" Width="200px"></asp:TextBox>(填写0为未提供折扣价)
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		原价：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtOldPrice"  Text='<%# Bind("OldPrice") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		是否需要配送：</td>
	<td height="25" width="*" align="left">
		<asp:CheckBox ID="chkCarr" Checked='<%# Bind("Carrying") %>' runat="server" />
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">展出日期：</td>
	<td height="25" width="*" align="left"><INPUT onselectstart="return false;" runat="server"  value='<%# Bind("ShowDate","{0:yyyy-MM-dd}") %>'
	 onkeypress="return false" id="txtShowDate" onblur="showHint(this,1)" onfocus="showHint(this,10,'outDate')"  type="text" size="10" name="Text1">
		 结束日期:<INPUT onselectstart="return false;" onkeypress="return false" id="txtEndDate" onfocus="setday(this)"
		  type="text" size="10" name="enddate" value='<%# Bind("EndDate","{0:yyyy-MM-dd}") %>' runat="server" />		
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
	
	<tr>
	<td height="25" width="30%" align="right">
		产品描述：</td>
	<td height="25" width="*" align="left">
	 <input type="hidden" runat="server"  name="Summary" id="TxtDes" value='<%# Bind("Des") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_TxtDes" frameborder="0" scrolling="no" width="380" height="180"></iframe>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">产品特色：</td>
	<td height="25" width="*" align="left">
	 <input type="hidden" runat="server"  name="txtFeature" id="txtFeature" value='<%# Bind("Feature") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtFeature" frameborder="0" scrolling="no" width="380" height="180"></iframe>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		产品信息
	：</td>
	<td height="25" width="*" align="left"><a onclick="javascript:window.open('Misc/upfile.aspx', '', 'width=400,height=250,resizable=0,scrollbars=no');"  style="text-decoration:underline; cursor:pointer" target="_blank">上传图片</a>
	<input type="hidden" runat="server"  name="txtProductInfo" id="txtProductInfo" value='<%# Bind("ProductInfo") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtProductInfo" frameborder="0" scrolling="no" width="420" height="340"></iframe>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		网络评论
	：</td>
	<td height="25" width="*" align="left">
	<input type="hidden" runat="server"  name="txtNetComment" id="txtNetComment" value='<%# Bind("NetComment") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtNetComment" frameborder="0" scrolling="no" width="420" height="200"></iframe>
	
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right"> 我们评论	：</td>
	<td height="25" width="*" align="left">
	
		<asp:TextBox id="txtWeComment" runat="server" BorderStyle="Dashed" Text='<%# Bind("WeComment") %>'  Rows="10" TextMode="MultiLine" Width="380px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right"> 备注	：</td>
	<td height="25" width="*" align="left">
	
		<asp:TextBox id="txtRemark" runat="server" BorderStyle="Dashed" Text='<%# Bind("Remark") %>'  Rows="3" TextMode="MultiLine" Width="380px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right">
		联系方式
	：</td>
	<td height="25" width="*" align="left">
	<input type="hidden" runat="server"  name="txttxtContact" id="txtContact" value='<%# Bind("Contact") %>' /></p>
 &nbsp;<iframe src="../../Content/163editor/editor.html?id=dtvProducts_txtContact" frameborder="0" scrolling="no" width="380" height="340"></iframe>
	
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right"> 商户名称	：</td>
	<td height="25" width="*" align="left">
		<asp:TextBox id="txtOwnerName"   Text='<%# Bind("OwnerName") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
	<tr>
	<td height="25" width="30%" align="right"> 商户电话	：</td>
	<td height="25">
		<asp:TextBox id="txtOwnerTel" Text='<%# Bind("OwnerTel") %>' runat="server" Width="200px"></asp:TextBox>
	</td></tr>
		<tr>
	<td height="25" colspan="2"><div align="center">
		<asp:Button ID="btnAdd" runat="server" Text="· 更新 ·"  CommandName="Update"></asp:Button>
	</div></td></tr>
</table>

              </EditItemTemplate>
            </asp:TemplateField>
        </Fields>
        </asp:DetailsView>
    </div>
</div>
    <asp:ObjectDataSource ID="odsProducts" runat="server" 
        DataObjectTypeName="Tuan.Model.Products" InsertMethod="Add" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetModel" 
        TypeName="Tuan.BLL.Products" UpdateMethod="Update" 
        oninserting="odsProducts_Inserting">
        <SelectParameters>
            <asp:QueryStringParameter Name="ProductID" QueryStringField="pid" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </form>
</body>
</html>
